//
//  WithdrawPriceCollectionViewCell.swift
//  LeTu
//
//  Created by gy on 2024/1/5.
//

import UIKit

class WithdrawPriceCollectionViewCell: UICollectionViewCell {

    override init(frame: CGRect) {
        super.init(frame: frame)
        
        configUI()
    }
    func setInfo(priceModel: WithdrawPriceModel, isSelect: Bool) {
        priceLabel.attributed.text = "\("¥", .font(kSetPingFangRegular(16)))\(priceModel.money)"
        priceLabel.textColor = isSelect ? .app_themeColor : .app_black
        backView.layer.borderColor = isSelect ? UIColor.app_themeColor.cgColor : UIColor.hex(hexString: "#F4F4F4").cgColor
//        backView.backgroundColor = isSelect ? .app_white : UIColor.hex(hexString: "#F4F4F4")
    }
    
    // MARK: - configUI
    func configUI() {
        
        contentView.addSubview(backView)
        backView.addSubview(priceLabel)
        
        backView.snp.makeConstraints { make in
            make.edges.equalToSuperview()
        }
        priceLabel.snp.makeConstraints { make in
            make.center.equalToSuperview()
        }
        
    }
    private lazy var backView: UIView = {
        let backView = UIView()
        backView.backgroundColor = UIColor.hex(hexString: "#F4F4F4")
        backView.layer.cornerRadius = 8
        backView.layer.masksToBounds = true
        backView.layer.borderWidth = 1
        return backView
    }()
    private var priceLabel: UILabel = {
        let priceLabel = UILabel()
        priceLabel.textAlignment = .center
        priceLabel.font = kSetPingFangBlod(30)
        return priceLabel
    }()
    
    required init?(coder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }
    
}
